/* admin.css */

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7fb;
    color: #333;
    margin: 0;
    padding: 0 20px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 20px 0;
    border-bottom: 3px solid #2c7be5;
    text-align: center;
}

header h1 {
    margin: 0;
    font-weight: 700;
    font-size: 2.2rem;
    color: #2c7be5;
}

nav a.btn-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    color: #2c7be5;
    text-decoration: none;
    border: 1.5px solid #2c7be5;
    padding: 5px 15px;
    border-radius: 5px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

nav a.btn-link:hover {
    background-color: #2c7be5;
    color: white;
}

main {
    flex-grow: 1;
    max-width: 960px;
    margin: 25px auto 0;
    background-color: white;
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(44, 123, 229, 0.15);
}

section {
    margin-bottom: 40px;
}

h2 {
    color: #2c7be5;
    font-weight: 700;
    font-size: 1.7rem;
    margin-bottom: 15px;
}

form.search-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.input-text,
.input-number,
.select-role {
    padding: 5px 8px;       /* 缩小上下和左右内边距 */
    border: 1.2px solid #ccc; /* 细一点的边框 */
    border-radius: 4px;     /* 圆角小点 */
    font-size: 0.9rem;      /* 字体稍微小点 */
    outline-offset: 2px;
    transition: border-color 0.3s ease;
}

.input-text:focus,
.input-number:focus,
.select-role:focus {
    border-color: #2c7be5;
    outline: none;
}

input.input-number {
    width: 100px;
}

.form-inline {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-primary {
    background-color: #2c7be5;
    border: none;
    color: white;
    padding: 10px 25px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.btn-primary:hover {
    background-color: #1a57b8;
}

.data-table {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    border: 1px solid #ccc;
    padding: 10px 12px;
    vertical-align: middle;
    word-wrap: break-word;
}

.data-table th {
    background-color: #2c7be5;
    color: white;
    font-weight: 600;
}

.update-form input {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 6px 8px;
    font-size: 1rem;
}

.data-table td {
    padding: 10px 12px;
    box-sizing: border-box; /* 确保内边距计算在内 */
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 30%; /* 书名列宽 */
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 25%; /* 作者列宽 */
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    width: 15%; /* 价格 */
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    width: 15%; /* 库存 */
}

.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 5%; /* ID */
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    width: 15%; /* 操作 */
}

.action-cell {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.update-form button.btn-update,
.delete-form button.btn-delete {
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.update-form button.btn-update {
    background-color: #27ae60;
    color: white;
}

.update-form button.btn-update:hover {
    background-color: #1e8449;
}

.delete-form button.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.delete-form button.btn-delete:hover {
    background-color: #c0392b;
}

.pagination {
    text-align: center;
    margin-top: 25px;
}

.pagination a {
    display: inline-block;
    margin: 0 5px;
    padding: 7px 13px;
    color: #2c7be5;
    text-decoration: none;
    border: 1.5px solid #2c7be5;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a.active,
.pagination a:hover {
    background-color: #2c7be5;
    color: white;
}

.empty-state {
    color: #999;
    font-style: italic;
    text-align: center;
    margin-top: 20px;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 15px 0;
    border-top: 1px solid #ccc;
    color: #555;
    font-size: 0.9rem;
}